import java.io.*;
import java.net.*;

public class ServerTest
{
	
	ServerSocket sockserv = null;

	public ServerTest()
	{
		try
		{
			sockserv = new ServerSocket(60000);
		}
		catch (IOException ex) { }
	}


	public void run()
	{
		int nb_clients = 0;
		System.out.println("Serveur demarré !");

		try
		{
			while (true)
			{
				Socket sockcli = sockserv.accept();
				nb_clients++;

				System.out.println("Connexion établie : "+nb_clients+"ème client");
				
				ThreadClient th = new ThreadClient(sockcli);
				th.start();
			}
		}
		catch (IOException ex) { }
	}


	public static void main (String args[])
	{
		ServerTest serv = new ServerTest();
		serv.run();
	}
}

